import request from '@/utils/request';

export async function page(params) {
  return request('/jmonkey/system/user/page', {
    method: 'GET',
    params
  });
}

export async function removeBatch(userIdList) {
  return request(`/jmonkey/system/user/removeBatch`, {
    method: 'DELETE',
    params: {
      userIdList
    }
  });
}

export async function checkUsername(data) {
  return request('/jmonkey/system/user/checkUsername', {
    method: 'POST',
    data,
  });
}

export async function save(data) {
  return request('/jmonkey/system/user/save', {
    method: 'POST',
    data,
  });
}

export async function update(data) {
  return request('/jmonkey/system/user/update', {
    method: 'PUT',
    data,
  });
}

export async function modifyPassword(data) {
  return request('/jmonkey/system/user/modifyPassword', {
    method: 'PUT',
    data,
  });
}

export async function lock(id) {
  return request(`/jmonkey/system/user/lock/${id}`, {
    method: 'GET'
  });
}

export async function unLock(id) {
  return request(`/jmonkey/system/user/unLock/${id}`, {
    method: 'GET'
  });
}
